#ifndef BUFF_H_
#define BUFF_H_

#include <sys/types.h>
#include <stdint.h>

#define EPOLL_BUF_SIZE 8192

struct buff {
    uint8_t buf[EPOLL_BUF_SIZE];
    size_t off, len;
};

ssize_t buffRead(struct buff *buff, int fd);
ssize_t buffWrite(struct buff *buff, int fd);
size_t buffPut(struct buff *buff, const void *buf, size_t count);
size_t buffGet(struct buff *buff, void *buf, size_t count);
size_t buffPeek(struct buff *buff, void *data, size_t off, size_t count);
size_t buffDrop(struct buff *buff, size_t off, size_t count);
void buffReset(struct buff *buff);

#endif /* BUFF_H_ */
